{$header} 
{$menu}
{$tiny}
{literal}
<script type = "text/javascript">
function getXMLHTTP() { //fuction to return the xml http object
        var xmlhttp=false;    
        try{
            xmlhttp=new XMLHttpRequest();
        }
        catch(e)    {        
            try{            
                xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e){
                try{
                req = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch(e1){
                    xmlhttp=false;
                }
            }
        }

        return xmlhttp;
    }
function getData(str){
    var xhr = false;
    if (window.XMLHttpRequest) {
            // IE7+, Firefox, Chrome, Opera, Safari
            xhr = new XMLHttpRequest();
        } 
        else {
            // IE5/IE6
            xhr = new ActiveXObject("Microsoft.XMLHTTP");
        }
        if (xhr) {
            xhr.onreadystatechange = function () {
                if (xhr.readyState == 2 && xhr.status == 200) {
                    document.getElementById("div1").innerHTML = '<input type="text" value="">';
                }
            }
			if(str == 2){
			 document.getElementById("div1").innerHTML = '<span>Limit :</span><br><input type="text" name="gift_num" value="">';
			}else {
				document.getElementById("div1").innerHTML ="";
			}
            // xhr.open("GET", "/display-product.php?q="+str, true);
            xhr.send(null);
        }
}
</script>
{/literal}
<div id="content">
    <div id="tab" class="radius-top">
    	Gift &gt;&gt; Add
        <div class="clear"></div></div>
		{$form_open}             
        <table>
              <tbody>
              <tr>
                  <td align="left">Status&nbsp;<span class="errors">*</span></td>
                  <td class="hotelInfo">
                  <input type="radio" value="1" name="status">
                  Active<input type="radio" value="0" name="status">Inactive <span class="errors">{$errorstatus}</span></td>
                </tr>
              <tr>
                <td align="left">Customer&nbsp;<span class="errors">*</span></td>
                <td class="hotelInfo">
                  {$customer}
                  <span class="errors">{$errorcustomer}</span>
                </td>
              </tr>  
              <tr>
                <td align="left">Gift Type</td>
                <td class="hotelInfo">
                 
                  <select title="Select one" name="gift_type" onChange="getData(this.value)">
                  	<option value="1">Other</option>
                    <option value="2">Limit</option>
                  </select>
                  &nbsp;&nbsp;&nbsp;<div  id="div1"></div>
                </td>
              </tr>
              <tr>
                <td align="left"> Name Th&nbsp;<span class="errors">*</span></td>
                <td class="hotelInfo"><label for="txtCategory"></label>
                <textarea name="title_th" id="txtCategory" cols="45" rows="5">{$title_th}</textarea>
                <span class="errors">{$errortitle_th}</span>
                </td>
                </tr>
                 <tr>
                   <td align="left" valign="top">Description Th</td>
                   <td class="hotelInfo"><textarea name="desc_th"  id="elm3" cols="45" rows="5">{$desc_th}</textarea></td>
                 </tr>
                 <tr>
                   <td align="left" valign="top">Picture<br />
                   (250 x 200 px)
                   </td>
                   <td class="hotelInfo"><input type="file" name="pic" id="txtCategory6"  />
                   <span class="errors">{$errorpic}</span>
                   </td>
                 </tr>
              </tbody>
            </table>
            <div id="bnt" class="mws-form-row">
<input type="submit"  name="bntSubmit" class="mws-button green" value="Save"  />
                <input type="button" name="bntSubmit" class="mws-button green" value="Cancel" onClick="window.location='{$url}manage_gift/gift_list';" />
  </div>
		{$form_close}
  </div>
  {$footer}